#pragma once
#include <QImage>
#include <QPainter>
#include <string>

typedef struct Point {
public:
	Point()
		:x(0), y(0){}
	Point(int _x, int _y)
	{
		x = _x;
		y = _y;
	}
	int x;
	int y;
} BDPoint;

class BDShape
{

public:

	enum Color {
		NONE,
		BLACK,
		WHITE,
		RED,
		YELLOW,
		GREEN,
	};

	BDShape(){}
	virtual ~BDShape(){}

	virtual void Draw(QPainter* painter){}
};

class BDCircle : public BDShape
{
public:

	BDCircle(BDPoint center, int radius, Color color) : m_iCenter(center), m_iRadius(radius), m_color(color){}
	virtual ~BDCircle(){}
	BDPoint GetCenter() { return m_iCenter; }
	int GetRadius() { return m_iRadius; }
	void Draw(QPainter* painter);
	bool Contains(const BDCircle& other);
	bool Intersects(const BDCircle& other);

protected:
	BDPoint m_iCenter;
	int m_iRadius;
	Color m_color;
};

class BDLine : public BDShape
{
public:
	BDLine(BDPoint point1, BDPoint point2) : m_Point1(point1), m_Point2(point2){}
	virtual ~BDLine(){}

	void Draw(QPainter* painter);

protected:
	BDPoint m_Point1;
	BDPoint m_Point2;
};

class BDImage : public BDShape
{
public:
	BDImage(QString path, int size, BDPoint pos) : m_Image(path), m_Percent(size), m_Pos(pos) {}
	//BDImage(BDPoint pos, QString path) : m_Pos(pos), m_Image(path){}
	virtual ~BDImage(){}

	void Draw(QPainter* painter);
	void SetPosAndSize(BDPoint pos, int percent)
	{
		m_Pos = pos;
		m_Percent = percent;
	}

protected:
	BDPoint m_Pos;
	QImage m_Image;
	int m_Percent;
};

class BDString : public BDShape
{
public:
	BDString(BDPoint pos, QString str) : m_Pos(pos), m_String(str) {}
	virtual ~BDString(){}

	void Draw(QPainter* painter);

protected:
	QString m_String;
	BDPoint m_Pos;
};